package {{wis-supportFilePackage}};

import java.util.Collections;
import java.util.List;

public class ComponentData<T> {

	protected Integer pageNumber;

	protected Integer pageSize;

	protected Long totalSize;

	protected List<T> rows;

	public ComponentData() {
	}

	public ComponentData(List<T> rows) {
		this.rows = rows;
	}

	public ComponentData(T singletonRowData) {
		this.rows = Collections.singletonList(singletonRowData);
	}

	public ComponentData(Integer pageNumber, Integer pageSize, Long totalSize, List<T> rows) {
		this.pageNumber = pageNumber;
		this.pageSize = pageSize;
		this.totalSize = totalSize;
		this.rows = rows;
	}

	public static <T> ComponentData<T> emptyData() {
		return new ComponentData<T>(Collections.<T>emptyList());
	}

	public Integer getPageNumber() {
		return pageNumber;
	}

	public void setPageNumber(Integer pageNumber) {
		this.pageNumber = pageNumber;
	}

	public Integer getPageSize() {
		return pageSize;
	}

	public void setPageSize(Integer pageSize) {
		this.pageSize = pageSize;
	}

	public Long getTotalSize() {
		return totalSize;
	}

	public void setTotalSize(Long totalSize) {
		this.totalSize = totalSize;
	}

	public List<T> getRows() {
		return rows;
	}

	public void setRows(List<T> rows) {
		this.rows = rows;
	}

}